package com.mos.service.impl;

import com.mos.base.sql.Page;
import com.mos.dao.UserDao;
import com.mos.entity.User;
import com.mos.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Package Name: com.mos.service.impl
 * User: grq
 * Date: 2016/3/24
 * Time: 15:01
 * Description:some des here!
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Transactional(readOnly = false)
    public void save(User user) {
        userDao.save(user);
    }

    public Page<User> queryPage(Integer pageNo, Integer pageSize, Object[] params) {
        return userDao.queryPage(pageNo,pageSize,params);
    }

    public User findById(int id) {
        return userDao.findById(id);
    }

    public Map<String, Object> find(int id) {
        return userDao.find(id);
    }

    public List<Map<String, Object>> queryList(String name) {
        return userDao.queryList(name);
    }
}
